package interfaces.tips;

import main.InitGame;
import main.listeners.listenerClasses.LanguageListener;

import org.fenggui.appearance.DefaultAppearance;
import org.fenggui.decorator.background.PlainBackground;
import org.fenggui.decorator.border.PlainBorder;
import org.fenggui.util.Color;

import interfaces.GUISource;
import interfaces.superWidgets.InterfaceButton;
import interfaces.superWidgets.StaticContent;

public abstract class TipWindow extends StaticContent {
	
	public TipWindow(int width, int height) {
		super(width, height);
		
		setupBG(getAppearance());
		getAppearance().add(new PlainBorder(Color.BLUE));
		
		InitGame.get().addLanguageListener(new LanguageListener() {
			@Override
			public void languageChanged() {
				init();
			}
		});
		
		layout();
	}
	
	protected void addButton(InterfaceButton button) {
		button.getAppearance().removeAll();
		GUISource.setTextColor(button, Color.WHITE);
		addWidget(button);
	}
	
	protected void setupBG(DefaultAppearance app) {
		app.removeAll();
		app.add(new PlainBackground(Color.BLUE));
	}
	
	protected abstract void init();
}